package com.zhudoo.zhilian.util.service;

import com.zhudoo.zhilian.dao.entity.User;
import com.zhudoo.zhilian.service.UserService;
import com.zhudoo.zhilian.util.StringUtils;

import static com.zhudoo.zhilian.service.UserService.*;

public class UserUtil {

    public static String getUserTypeBrief(User user) {
        if (user.getType() == UserService.TYPE_3) {
            String userTypeBrief = "对方为";
            userTypeBrief = userTypeBrief + (StringUtils.isNotEmpty(user.getAgentCompany()) ? user.getAgentCompany() + "公司" : AGENT_ROLE_TYPE_MAP.get(user.getAgentRoleType()));
            userTypeBrief = userTypeBrief + ((user.getAgentFreeType() != null && user.getAgentFreeType() != 0) ? AGENT_FREE_TYPE_MAP.get(user.getAgentFreeType()) : "");
            userTypeBrief = userTypeBrief + ((user.getAgentPrice() != null && user.getAgentPrice() != 0) ? "(" + user.getAgentPrice() + "%)" : "");
            userTypeBrief = userTypeBrief + "实名认证经纪人";
            //对方身份信息
            return userTypeBrief;
        } else if (user.getType() == UserService.TYPE_2) {
            return "已实名认证房东，如有问题及时举报";
        } else {
            if (user.getCertificationStatus() == CERTIFICATION_STATUS_3) {
                return "已实名租客,如有问题及时举报";
            } else {
                return "未实名用户,请谨慎沟通,如有问题及时举报";
            }
        }
    }
}
